package com.houseService.users.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.houseService.common.core.page.TableDataInfo;
import com.houseService.common.utils.PageUtils;
import com.houseService.users.domain.Users;
import com.houseService.users.vo.UsersVo;
import com.houseService.users.mapper.UsersMapper;
import com.houseService.users.service.IUsersService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户Service业务层处理
 *
 * @author LiuChunlin
 * @date 2025-03-18
 */
@Slf4j
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements IUsersService {

    @Override
    public TableDataInfo<UsersVo> queryList(UsersVo entity) {
        return PageUtils.buildDataInfo(this.baseMapper.queryList(PageUtils.buildPage(), entity));
    }

    @Override
    public List<UsersVo> queryAll(UsersVo entity) {
        return this.baseMapper.queryList(entity);
    }


    @Override
    public UsersVo queryById(String id) {
        return this.baseMapper.queryById(id);
    }

    @Override
    public Boolean updateUsersId(UsersVo users) {
        return this.baseMapper.updateUsersId(users) > 0;
    }

    @Override
    public Boolean insertUsers(UsersVo users) {
        log.info("================================================================");
        log.info("{}", users);
        log.info("================================================================");
        return this.baseMapper.insertUsers(users) > 0;
    }
}
